import { defineComponent as u, reactive as p, openBlock as r, createElementBlock as f, normalizeClass as h, normalizeStyle as _, unref as m, renderSlot as C, computed as w, createElementVNode as b, createBlock as k, createCommentVNode as z } from "vue";
function x(n, a) {
  let e = null, t = null;
  return function(...l) {
    const c = this, o = (/* @__PURE__ */ new Date()).getTime();
    t ? (clearTimeout(e), e = window.setTimeout(
      function() {
        o - t >= a && (n.apply(c, l), t = o);
      },
      a - (o - t)
    )) : (n.apply(c, l), t = o);
  };
}
const B = /* @__PURE__ */ u({
  name: "yu-button",
  __name: "YuButton",
  props: {
    size: { default: "medium" },
    bgColor: { default: "#efada1" },
    textColor: { default: "#fff" },
    circle: { type: Boolean, default: !1 },
    throttleTime: { default: 0 }
  },
  emits: ["click"],
  setup(n, { emit: a }) {
    const e = n, t = p({
      "yu-button": !0
    }), l = p({
      "background-color": e.bgColor,
      color: e.textColor
    });
    t["btn" + e.size] = !0;
    const c = {
      large: 46,
      medium: 36,
      small: 30,
      mini: 26
    };
    e.circle && (l["border-radius"] = c[e.size] + "px");
    const o = a, i = x(function() {
      o("click");
    }, e.throttleTime);
    return (s, d) => (r(), f("div", {
      class: h(t),
      style: _(l),
      onClick: d[0] || (d[0] = //@ts-ignore
      (...v) => m(i) && m(i)(...v))
    }, [
      C(s.$slots, "default")
    ], 6));
  }
}), M = {
  clear: '<svg t="1733808799411" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6779" width="16" height="16"><path d="M512 139.17297778c205.90407933 0 372.82702222 166.9229429 372.82702222 372.82702222s-166.9229429 372.82702222-372.82702222 372.82702222-372.82702222-166.9229429-372.82702222-372.82702222 166.9229429-372.82702222 372.82702222-372.82702222z m0 62.13783704c-171.58328067 0-310.68918518 139.10590451-310.68918518 310.68918518 0 171.58328067 139.10590451 310.68918518 310.68918518 310.68918518 171.58328067 0 310.68918518-139.10590451 310.68918518-310.68918518 0-171.58328067-139.10590451-310.68918518-310.68918518-310.68918518z m168.04142397 141.67426843c11.3919368 11.43336202 12.0961656 29.49475998 2.15411168 41.73591389l-2.15411168 2.36123779-124.08926058 124.42066237 125.06275336 125.43558037 2.13339907 2.3612378c9.96276654 12.2411539 9.25853772 30.30255186-2.13339907 41.71520128-11.3919368 11.41264941-29.39119692 12.13759084-41.5909256 2.13339907l-2.36123782-2.13339907L512 555.60004898l-125.06275333 125.41486777a31.0274933 31.0274933 0 0 1-43.95216342 0 31.23461941 31.23461941 0 0 1-2.13339907-41.71520128l2.13339907-2.3612378 125.04204075-125.43558037-124.06854797-124.42066237-2.15411168-2.36123779a31.23461941 31.23461941 0 0 1 2.15411168-41.71520127 31.0274933 31.0274933 0 0 1 41.5909256-2.13339907l2.3612378 2.13339907L512 467.40574562l124.06854795-124.39994975a31.0274933 31.0274933 0 0 1 43.97287602 0z" p-id="6780" fill="#dcdfe6"></path></svg>',
  test: '<svg t="1733812113789" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7143" width="16" height="16"><path d="M512 544m-96 0a48 48 0 1 0 192 0 48 48 0 1 0-192 0Z" p-id="7144" fill="#ff0000"></path><path d="M512 544m-96 0a48 48 0 1 0 192 0 48 48 0 1 0-192 0Z" p-id="7145" fill="#ff0000"></path><path d="M960 544 640 544c0 47.8-26.2 89.4-65.2 111.4L731.2 928C866.2 850.8 960 710.6 960 544z" p-id="7146" fill="#ff0000"></path><path d="M512 416c23.4 0 45.4 6.4 64.2 17.4l161.2-276.6C671.2 118.2 594.2 96 512 96c-82.4 0-159.8 22.4-226.2 61.2l159.6 277.6C464.8 422.8 487.6 416 512 416z" p-id="7147" fill="#ff0000"></path><path d="M384 544 64 544c0 166.6 93.8 306.8 228.8 384l156.4-272.6C410.2 633.4 384 591.8 384 544z" p-id="7148" fill="#ff0000"></path></svg>'
}, I = ["innerHTML"], T = /* @__PURE__ */ u({
  name: "yu-icon",
  __name: "YuIcon",
  props: {
    name: {},
    size: { default: 16 },
    color: { default: "#dcdfe6" }
  },
  emits: ["click"],
  setup(n, { emit: a }) {
    const e = n, t = w(() => {
      const o = M[e.name];
      return o ? o.replace(/(width|height)="?\d+"/g, `width="${e.size}"`).replace(/fill="[^"]*"/g, `fill="${e.color}"`) : "";
    }), l = a, c = () => {
      l("click");
    };
    return (o, i) => (r(), f("div", {
      class: "yu-icon-warper",
      innerHTML: t.value,
      onClick: c
    }, null, 8, I));
  }
}), g = (n, a) => {
  const e = n.__vccOpts || n;
  for (const [t, l] of a)
    e[t] = l;
  return e;
}, y = /* @__PURE__ */ g(T, [["__scopeId", "data-v-87ef754b"]]), V = { class: "yu-input-wrapper" }, L = ["type", "value", "placeholder", "disabled", "readonly", "name"], $ = /* @__PURE__ */ u({
  name: "yu-input",
  __name: "YuInput",
  props: {
    type: { default: "text" },
    modelValue: {},
    placeholder: { default: "" },
    disabled: { type: Boolean, default: !1 },
    readonly: { type: Boolean, default: !1 },
    name: { default: "" },
    clearable: { type: Boolean, default: !1 }
  },
  emits: ["update:modelValue", "change"],
  setup(n, { emit: a }) {
    const e = n, t = p({
      "yu-input": !0
    }), l = a, c = (s) => {
      l("update:modelValue", s.target.value);
    }, o = (s) => {
      l("change", s.target.value);
    }, i = () => {
      l("update:modelValue", ""), l("change", "");
    };
    return (s, d) => (r(), f("div", V, [
      b("input", {
        type: e.type,
        class: h(t),
        value: s.modelValue,
        onInput: c,
        onChange: o,
        placeholder: e.placeholder,
        disabled: e.disabled,
        readonly: e.readonly,
        name: e.name
      }, null, 42, L),
      e.clearable ? (r(), k(y, {
        key: 0,
        name: "clear",
        onClick: i
      })) : z("", !0)
    ]));
  }
}), S = /* @__PURE__ */ g($, [["__scopeId", "data-v-d3de40f3"]]), E = [B, S, y], H = (n, a) => {
  E.forEach((e) => {
    n.component(e.name, e);
  });
};
export {
  H as default
};
